package routers

import (
	"github.com/gin-gonic/gin"
	"shop-admin/controller"
	"shop-security/preAuthorize"
)

func privateStoreCategory(router *gin.RouterGroup) {
	api := &controller.StoreCategoryController{}
	storeCategory := router.Group("/product/category")
	{
		storeCategory.GET("/list", preAuthorize.HasPermission("prod:category:list"), api.List)
		storeCategory.GET("/info/:categoryId", preAuthorize.HasPermission("prod:category:info"), api.Info)
		storeCategory.POST("", preAuthorize.HasPermission("prod:category:save"), api.Save)
		storeCategory.PUT("", preAuthorize.HasPermission("prod:category:update"), api.Update)
		storeCategory.DELETE("/:categoryId", preAuthorize.HasPermission("prod:category:delete"), api.Delete) //删除分类
	}
}
